package com.medistat.model;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.GenericGenerator;

import com.medistat.model.enums.Days;
import com.medistat.model.enums.TypeOfWork;

@Entity
public class Setting extends StandardPersistentObject {
	
	@Id @GeneratedValue(generator="ID_GENERATOR_FOR_SETTING")
	@GenericGenerator(name="ID_GENERATOR_FOR_SETTING", strategy = "increment")
	private Long id;
	
	//parent - back reference
	@ManyToOne(targetEntity=Department.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="DepartmentID", referencedColumnName="ID") })	
	@Basic(fetch=FetchType.LAZY)
	private Department department;
	
	private Days dayInWeek;
	private Long doctorId;
	private TypeOfWork typeOfWork;
	private Integer weekInMonth;
	
	@Override
	public Long getId() {
		return id;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Days getDayInWeek() {
		return dayInWeek;
	}

	public void setDayInWeek(Days dayInWeek) {
		this.dayInWeek = dayInWeek;
	}

	public Long getDoctorId() {
		return doctorId;
	}

	public void setDoctorId(Long doctorId) {
		this.doctorId = doctorId;
	}

	public TypeOfWork getTypeOfWork() {
		return typeOfWork;
	}

	public void setTypeOfWork(TypeOfWork typeOfWork) {
		this.typeOfWork = typeOfWork;
	}

	public Integer getWeekInMonth() {
		return weekInMonth;
	}

	public void setWeekInMonth(Integer weekInMonth) {
		this.weekInMonth = weekInMonth;
	}
}
